package com.yuandian.utils;

public class DataTypeUtil {

	/**
	 * Object转换为String
	 * @param obj
	 * @return
	 */
	public static String objectToString(Object obj) {
		if (obj != null) {
			return obj.toString();
		}
		return "";
	}
	
	/**
	 * Object转换为Long
	 * @param obj
	 * @return
	 */
	public static Long objectToLong(Object obj) {
		if (obj != null) {
			return Long.valueOf(obj.toString());
		}
		return null;
	}
	
	/**
	 * Object转换为Integer
	 * @param obj
	 * @return
	 */
	public static Integer objectToInteger(Object obj) {
		if (obj != null) {
			return Integer.valueOf(obj.toString());
		}
		return null;
	}
}
